package main

import "fmt"

func main(){


	 obj := Constructor()
	 obj.Push(-2)
	obj.Push(-3)
	obj.Push(8)
	obj.Push(-3)
	 obj.Pop()
	 param_3 := obj.Top()
	 param_4 := obj.GetMin()
	fmt.Println(param_3)
	fmt.Println(param_4)

}

type MinStack struct {
	Vals *Stack
	Mins *Stack
	Size int
}

func Constructor() MinStack {
	return MinStack{
		Vals:NewStack(),
		Mins:NewStack(),
	}
}


func (this *MinStack) Push(val int)  {
	if this.Size == 0 {
		this.Mins.Push(val)
		this.Vals.Push(val)
	} else {
		this.Vals.Push(val)
		if val < this.Mins.Top() {
			this.Mins.Push(val)
		} else {
			this.Mins.Push(this.Mins.Top())
		}
	}
	this.Size ++
}


func (this *MinStack) Pop()  {
	this.Vals.Pop()
	this.Mins.Pop()
	this.Size --
}


func (this *MinStack) Top() int {
	return this.Vals.Top()
}


func (this *MinStack) GetMin() int {
	return this.Mins.Top()
}



type Stack struct {
	Arr []int
	Size int
}

func NewStack() *Stack {
	return &Stack{}
}

func (stack *Stack) Push(val int) {
	stack.Arr = append(stack.Arr, val)
	stack.Size++
}

func (stack *Stack)Pop() {
	stack.Size--
	stack.Arr = stack.Arr[:stack.Size]
}

func (stack *Stack)Top() int {
	return stack.Arr[stack.Size-1]
}

func (stack *Stack)Len()int{
	return stack.Size
}